import React, {Component} from 'react';
import classnames from 'classnames';

const prefixCls = 'titlePage-';

export default class TitlePage extends Component{
    render(){
        const hasTitle = (this.props.title == null);
        const titleClassName = classnames({
            [`${prefixCls}title`]: true,
            [`${prefixCls}title-hide`]: hasTitle
        });
        const containerClassName = classnames({
            [`${prefixCls}container`]: true,
            [`${prefixCls}container-full`]: hasTitle
        });

        return (
            <div className='titlePage'>
                <div className={titleClassName}>{this.props.title}</div>
                <div className={containerClassName}>
                    {this.props.children}
                </div>
            </div>
        )
    }
}